package com.xindong.paking.service;

import com.baomidou.mybatisplus.extension.api.R;
import com.xindong.paking.dtos.TbBalanceListParams;
import com.xindong.paking.entity.TbBalance;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xindong.paking.utils.Result;

/**
 * <p>
 *  余额服务类
 * </p>
 *
 * @author wenbo
 * @since 2023-01-11
 */
public interface TbBalanceService extends IService<TbBalance> {

    /**
     * 增加余额
     * @param tbBalance
     * @return
     */
    public Result add(TbBalance tbBalance);

    /**
     * 删除余额
     * @param id
     * @return
     */
    public Result delete(Integer id);

    /**
     * 更新余额
     * @param tbBalance
     * @return
     */
    public Result update(TbBalance tbBalance);

    /**
     * 分页查询余额
     * @param params
     * @return
     */
    public Result list(TbBalanceListParams params);

    /**
     * 余额充值
     * @param money
     * @return
     */
    public Result recharge(Double money);

    /**
     * 余额扣款
     * @param money
     * @return
     */
    public Result deduction(Double money);

    /**
     * 积分增加
     * @param integral
     * @return
     */
    public Result pointsIncrease(Integer integral);

    /**
     * 积分兑换
     * @param integral
     * @return
     */
    public Result pointsRedemption(Integer integral);

    /**
     * 根据id查询用户余额
     * @param userId
     * @return
     */
    Result selectMoneyByUserId(Integer userId);

    /**
     * 根据id查询用户积分
     * @param userId
     * @return
     */
    Result selectIntegralByUserId(Integer userId);

    /**
     * 根据id增加余额
     * @param tbBalance
     * @return
     */
    Result addMoneyByUserId(TbBalance tbBalance);

    /**
     * 根据id增加积分
     * @param tbBalance
     * @return
     */
    Result addIntegralByUserId(TbBalance tbBalance);
}
